Conversation
Vendor the official Sol-Attn kernels into TeleFuser and expose them through the compile-aware public attention ops with dense fallbacks. Adapt Wan2.1 to the official Morton3D token order, dense warmup schedule, layer guard, threshold policy, and automatic SM90 KV splitting. Keep the runtime integration compact by sharing sparse dispatch and token-order helpers. Add kernel, ops, model, and pipeline coverage, including H100 numerical checks and Morton round-trip validation. Document configuration, packaging, compatibility, and Wan2.1 usage. Verification: 29 related tests passed; ruff check and format checks passed; git diff --check passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Integrate Sol-Attn as a built-in TeleFuser attention backend and add an official-profile adaptation for Wan2.1.
The PR vendors the Sol-Attn kernels into
telefuser.kernel.sol_attn, exposes them throughtelefuser.ops.attention, and adds Wan2.1 Morton3D token ordering, dense warm-up guards, threshold configuration, and automatic KV split selection.Motivation
Wan2.1 video generation produces long token sequences where dense attention is expensive. Sol-Attn dynamically selects sparse attention blocks and reduces attention latency while retaining output quality.
Keeping the kernels inside TeleFuser also avoids coupling Sol-Attn to the independently packaged
tf-kerneldistribution. Unsupported inputs automatically use the existing dense fallback.Type of Change
Changes Made
telefuser/kernel/sol_attn, including license and third-party notices.AttnImplType.SOL_ATTNandAttentionConfig.sol_attention()with the official Wan2.1 defaults:dense_timesteps=10dense_layers=1tau=1.0threshold_type="diag"kv_splits="auto"telefuser.ops.attentionlayer with native dense fallbacks.Testing
Test commands:
Result:
29 passed. The H100 tests execute the actual Sol-Attn kernel and compare its output with PyTorch SDPA.Checklist
ruff)pytest tests/was not run)[Feature] Integrate Sol-Attn for Wan2.1Related Issues
N/A
Additional Notes
tf-kernel.8a26fb0ec9e353125ead798cb2e312d5ce48cded.THIRD_PARTY_NOTICES.md.GPU Architecture Support
Performance Impact
Measured against
mainusing Wan2.1-T2V-1.3B on one H100:Encoded-video comparison against the FlashAttention 4 output:
The comparison used identical prompts, seed, scheduler parameters, output dimensions, frame count, and encoding settings. Results are from a single H100 run and may vary by environment.